package com.chenjt.customizePage.imageCode;

import java.awt.image.BufferedImage;
import java.time.LocalDateTime;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2025/1/26 17:26
 */
public class ImageCode {


    private BufferedImage image;

    /**
     * 校验码内容
     */
    private String code;

    /**
     * 到期时间
     */
    private LocalDateTime expireDateTime;

    public ImageCode(BufferedImage image, String code, Integer expireInt) {
        this.image = image;
        this.code = code;
        // 当前时间往后移60秒，就是校验码的过期时间
        this.expireDateTime = LocalDateTime.now().plusSeconds(expireInt);
    }

    public ImageCode(String code,Integer expireInt){
        this.code = code;
        // 当前时间往后移60秒，就是校验码的过期时间
        this.expireDateTime = LocalDateTime.now().plusSeconds(expireInt);
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public LocalDateTime getExpireDateTime() {
        return expireDateTime;
    }

    public void setExpireDateTime(LocalDateTime expireDateTime) {
        this.expireDateTime = expireDateTime;
    }
}
